<template>
	<view class="guide-page">
		<bnn-loading :loading="isLoading"/>
		<view class="guide-scroll">
			<view class="news-content">
				<rich-text :nodes="info.content | getRichText" class="rich-text"/>
			</view>
		</view>
	</view>
</template>

<script>
	import {getArticleView} from '@/api/addons.js'
	import BnnLoading from '@/components/bnn-ui/loading/index.vue'
	
	export default {
		components: {
			BnnLoading
		},
		data() {
			return {
				info: {},
				isLoading: true
			}
		},
		onLoad(options) {
			this.getInfo(options.id)
		},
		methods: {
			getInfo (id) {
				getArticleView({id}).then(res => {
					this.info = res.data
					uni.setNavigationBarTitle({
						title: res.data.title
					})
					setTimeout(() => {
						this.isLoading = false
					}, 600)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.guide-page{
		.guide-scroll{
			min-height: 100vh;
			background-color: #fff;
			background-image: url(/static/images/bg_01.png);
			background-size: 100% 100%;
		}
	}
</style>
